from django.shortcuts import render


# Create your views here.
from personal import models
from personal.models import User


def index(request):
    return render(request, 'personal/index.html')


def doregister(request):
    name = request.POST.get('name')
    passwd = request.POST.get('password')

    lname = User.objects.get(name)

    if lname==True:
        return render(request, 'personal/register.html')
    else:
        obj = models.User(user_account=name, user_passwd=passwd)
        obj.save()
        return render(request, 'personal/login.html')


def dologin(requset):
    return None


def shoes(request):
    return render(request, 'personal/index.html')


def vipshop(request):
    return render(request, 'personal/vip.html')
